package com.zou.lotterylucky.data

import io.objectbox.annotation.Entity
import io.objectbox.annotation.Id
import io.objectbox.relation.ToOne

//一注
@Entity
class BetEntity {
    @Id
    var sqlId: Long = 0L
    var betNumber: Int = 0 //号码
    var betMoney: Float = 0f //金额
    var isPool: Boolean = false //是否是pool
    var betEndTime = 0L //一场结束的时间
    var type: Int = 4 //位数，2或3或4
    lateinit var deal: ToOne<DealEntity> //关联到订单

    fun getNumberString(): String {
        return String.format("%0${type}d", betNumber)
    }

    override fun toString(): String {
        return "BetEntity(sqlId=$sqlId, betNumber=$betNumber, betMoney=$betMoney, isPool=$isPool, betEndTime=$betEndTime, type=$type, deal=$deal)"
    }

}